#ifndef __GWPOLYMORPHDETECTOR_HPP__
#define __GWPOLYMORPHDETECTOR_HPP__

/**
*@file       gwpolymorphdetector.h
*@brief      detective  whether an object type is polymorphic at Compiling-Time.
*
*@author     graywind
*@version    1.0.0.0
*@data       2011/12/27
*/

///util stuff
namespace gwBedrockUtil
{
        ///detective whether this type is polymorphic
        template<class T>
        struct gwPolymorphDetector;
}

///util stuff
namespace gwBedrockUtil
{
        ///detective whether this type is polymorphic
        template<class T>
        struct gwPolymorphDetector
        {
                struct dummy1 : T { dummy1(); ~dummy1(); };
                struct dummy2 : T { dummy2(); virtual ~dummy2(); };
                enum { isPolymorph = sizeof(dummy1) == sizeof(dummy2), };
        };
}

#endif
